﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using Calendar.Models.Objects;

namespace Calendar.Models
{
    public class InitData : DropCreateDatabaseIfModelChanges<CalendarContext>
    {
        private List<MasterCode> masterCodeList = new List<MasterCode>();
        private List<Event> vocabularyList = new List<Event>();


        protected override void Seed(CalendarContext context)
        {
            MasterCode master = new MasterCode();
            master.Id = 1;
            master.Name = "Phim";
            context.MasterCodes.Add(master);

            master = new MasterCode();
            master.Id = 2;
            master.Name = "Tin tuc";
            context.MasterCodes.Add(master);

            Event ev = new Event();
            ev.Title = "Phim " + 1;
            ev.MasterCodeId = 1;

            ev.Start = DateTime.Now;
            ev.End = DateTime.Now;
            context.Events.Add(ev);
        }
    }
}